package hc.cn.sp04.order.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import sp01.pojo.User;
import web.util.JsonResult;

/**
 * @author 海绵宝宝
 * date 2021/10/29 11:02
 */
@FeignClient(name = "user-service")
public interface UserClient {
//    获取用户
    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable Integer userId);
//    增加用户积分
    @GetMapping("/{userId}/score")//通过问号拼接参数  @RequestParam进行拼接参数（）里面放的是参数名
    JsonResult<?> addScore(@PathVariable Integer userId,
                           @RequestParam("score") Integer score);
}
